<html>
	<head>
	  <title><?php echo lang('titre').' '.$etudiant->GMET_NOM.' '.$etudiant->GMET_PRENOM;?></title>
	  <?php include("/../base_site/script_base_site.php");?>
	  <link rel="stylesheet"  type="text/css" href="<?php echo base_url(); ?>css/ancien_css.css">
	  <script>

	  	$(document).ready(function()
	  	{

	  		$.ajaxSetup({
			        scriptCharset: "iso-8859-1",
			        cache: false
			});
	  		$("#link_div_photo").click(function()
	  		{
			    $("#div_photo").fadeToggle();
			});
			$("#close_div_photo").click(function()
	  		{
			    $("#div_photo").fadeToggle();
			});
			$("#change_photo").click(function()
	  		{
			    $("#div_photo").fadeToggle();
			});
			$("#link_div_file").click(function()
	  		{
			    $("#div_file").fadeToggle();
			});
			$("#plus_div_file").click(function()
	  		{
			    $("#div_file").fadeToggle();
			});
			$("#close_div_file").click(function()
	  		{
			    $("#div_file").fadeToggle();
			});
			$("#link_div_sns").click(function()
	  		{
			    $("#div_sns").fadeToggle();
			});
			$("#plus_div_sns").click(function()
	  		{
			    $("#div_sns").fadeToggle();
			});
			$("#close_div_sns").click(function()
	  		{
			    $("#div_sns").fadeToggle();
			});

			$("#div_job").on('click','#close_div_job',function()
	  		{
			    $("#div_job").fadeToggle();
			});


			$('form').on('submit',function(e) {
				   e.preventDefault();
			});
			$("#info_files").on('click','.a_link_file',function(e) {
				e.preventDefault();
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE="+"<?php echo $etudiant->GMET_CODE;?>&GMDA_CODE="+$(this).closest('form').find("input:hidden").val(),
							success : function(data)
							{	
								var container = $('#info_files'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#info_social_networks").on('click','.a_activation',function(e) {
				e.preventDefault();
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE="+"<?php echo $etudiant->GMET_CODE;?>&GMRS_CODE="+$(this).closest('form').find("input:hidden").val(),
							success : function(data)
							{	
								var container = $('#info_social_networks'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#info_social_networks").on('click','.a_delete_sns',function(e) {
				e.preventDefault();
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE="+"<?php echo $etudiant->GMET_CODE;?>&GMRS_CODE="+$(this).closest('form').find("input:hidden").val(),
							success : function(data)
							{	
								var container = $('#info_social_networks'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			
			$("#info_social_networks").on('click','.a_activation_all_sns',function(e) {
				e.preventDefault();
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>",
							success : function(data)
							{	
								var container = $('#info_social_networks'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#div_sns").on('submit',function(e) {
				e.preventDefault();
				$.ajax({
							url : $(this).find('form').attr('action'),
							type : 'POST', 
							data : "GMET_CODE="+"<?php echo $etudiant->GMET_CODE;?>&GMRS_CODE="+$(this).find('form').find("select").val()+"&GMERS_LINK="+$(this).find('form').find("input[name=GMERS_LINK]").val(),
							success : function(data)
							{	
								$("#div_sns").fadeToggle();
								var container = $('#info_social_networks'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			/*var options = {
			    beforeSend: function()
			    {
			 		alert("avant envoi");
			    },
			    uploadProgress: function(event, position, total, percentComplete)
			    {
			 
			    },
			    success: function()
			    {
			 		alert("succès");
			    },
			    complete: function(response)
			    {
			    	alert("terminé");
				    var container = $('#list_studies'); 
					if(response)
					{
						container.html(response);
					}
				}
			 
			};
			$('#add_studies').find('form').ajaxForm(options);*/

			$("#add_studies").find('form').on('submit',function(e) {
				e.preventDefault();
				alert($(this).find('form').attr('action'));
				/*$.ajaxFileUpload({
							url : $(this).find('form').attr('action'),
							secureuri : false,
							fileElementId:,
							type : 'json', 
							data : {
						                'GMET_CODE' : $(this).find('form').find('input:hidden[name=GMET_CODE]').val(),
						                'GMES_ETABLISSEMENT' : $(this).find('form').find("input[name=GMES_ETABLISSEMENT]").val(),
						                'GMES_OPTION' : $(this).find('form').find("input[name=GMES_OPTION]").val(),
						                'GMES_SPECIALISATION' : $(this).find('form').find("input[name=GMES_SPECIALISATION]").val(),
						                'GMES_DATE_DE_DEBUT' : $(this).find('form').find("input[name=GMES_DATE_DE_DEBUT]").val(),
						                'GMES_DATE_DE_FIN' : $(this).find('form').find("input[name=GMES_DATE_DE_FIN]").val(),
						                'GMES_NOM_DU_DIPLOME' : $(this).find('form').find("input[name=GMES_NOM_DU_DIPLOME]").val()
						            },
							success : function(data)
							{	
								var container = $('#list_studies'); 
								if(data)
								{
									container.html(data);
								}
							}
						});*/
			});

			
			
			$("#info_studies").on('click','#plus_form_div_studies',function(e) {
				e.preventDefault();
				alert("je suis ici");
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>",
							success : function(data)
							{	
								var container = $('#add_studies'); 
								if(data)
								{
									container.html(data);
									$("input:submit").button()
									 .css({
									    'text-align' : 'left',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									$('select').selectmenu();
									$('input[type=text]').button()
								    .off('mouseenter').off('mousedown').off('keydown')
								    .css({
									          'font' : 'inherit',
									         'color' : 'inherit',
									    'background' : '#FFFFFF',
									    'text-align' : 'left',
									'vertical-align' : 'center',
									       'outline' : 'none',
									        'cursor' : 'text',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									var currentdate = new Date();
									 $("#datepicker_studies_deb" ).datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $("#datepicker_studies_fin").datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										defaultDate: currentdate,
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $('#datepicker_studies_deb').datepicker('setDate',-1);
							        $('#datepicker_studies_fin').datepicker('setDate',currentdate);
							        $("button, input:submit, input:button").button();
							        $('input:text, input:password, input[type=email],textarea').button()
								    .addClass('ui-textfield')
								    .off('mouseenter').off('mousedown').off('keydown');
								}
							}
						});
			});

			$("#div_add_emploi").on('submit',function(e) {
				alert("je suis ici");
				e.preventDefault();
				/*var data_form = "GMET_CODE="+$(this).find('form').find('input:hidden[name=GMET_CODE]').val()+"&GMEM_FONCTION="+$(this).find('form').find("input[name=GMEM_FONCTION]").val()+"&GMEM_EMAIL="+$(this).find('form').find("input[name=GMEM_EMAIL]").val()+"&GMEM_TELEPHONE="+$(this).find('form').find("input[name=GMEM_TELEPHONE]").val()+"&GMEM_NOM_ENTREPRISE="+$(this).find('form').find("input[name=GMEM_NOM_ENTREPRISE]").val()+"&GMEM_TYPE_CONTRAT="+$(this).find('form').find("select[name=GMEM_TYPE_CONTRAT]").val()+"&GMEM_DATE_EMBAUCHE="+$(this).find('form').find("input[name=GMEM_DATE_EMBAUCHE]").val()+"&GMEM_DATE_FIN="+$(this).find('form').find("input[name=GMEM_DATE_FIN]").val()+"&GMEM_SALAIRE_ANNUEL="+$(this).find('form').find("input[name=GMEM_SALAIRE_ANNUEL]").val()+"&GMEM_ADRESSE="+$(this).find('form').find("input[name=GMEM_ADRESSE]").val()+"&GMEM_CODE_POSTAL="+$(this).find('form').find("input[name=GMEM_CODE_POSTAL]").val()+"&GMEM_VILLE="+$(this).find('form').find("input[name=GMEM_VILLE]").val()+"&GMEM_PAYS="+$(this).find('form').find("input[name=GMEM_PAYS]").val()+"&GMEM_NUMERO_ORDRE="+$(this).find('form').find("select[name=GMEM_NUMERO_ORDRE]").val()+"&GMEM_ACTUEL="+$(this).find('form').find("input[name=GMEM_ACTUEL]:checked").val();
				alert($(this).find('form').attr('action'));
				alert(data_form);
				$.ajax({
							url : $(this).find('form').attr('action'),
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $('#travail_ancien'); 
								if(data)
								{
									container.html(data);
								}
							}
						});*/
			});

			
			
			$("#travail_ancien").on('click','#plus_form_div_emploi',function(e) {
				e.preventDefault();
				alert("je suis ici");
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>",
							success : function(data)
							{	
								var container = $('#travail_ancien'); 
								if(data)
								{
									container.html(data);
									$("input:submit").button()
									 .css({
									    'text-align' : 'left',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									$('select').selectmenu();
									$('input[type=text]').button()
								    .off('mouseenter').off('mousedown').off('keydown')
								    .css({
									          'font' : 'inherit',
									         'color' : 'inherit',
									    'background' : '#FFFFFF',
									    'text-align' : 'left',
									'vertical-align' : 'center',
									       'outline' : 'none',
									        'cursor' : 'text',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									var currentdate = new Date();
									 $("#datepicker_deb" ).datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $("#datepicker_fin").datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										defaultDate: currentdate,
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $('#datepicker_deb').datepicker('setDate',-1);
							        $('#datepicker_fin').datepicker('setDate',currentdate);
							        $("button, input:submit, input:button").button();
							        $('input:text, input:password, input[type=email],textarea').button()
								    .addClass('ui-textfield')
								    .off('mouseenter').off('mousedown').off('keydown');
								}
							}
						});
			});

			$("#travail_ancien").on('click','.a_delete_emploi',function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>&GMEM_CODE="+$(this).closest('form').find('input:hidden[name=GMEM_CODE]').val();
				$.ajax({
							url : $(this).attr('href'),
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $('#travail_ancien'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#travail_ancien").on('click','.a_edit_emploi',function(e) {
				e.preventDefault();
				var div = $(this).closest('div[id^="info_emploi_"]');
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>&GMEM_CODE="+$(this).closest('form').find('input:hidden[name=GMEM_CODE]').val();
				var url_link = $(this).attr('href');
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								//$("#div_job").fadeToggle();
								var container = div; 
								if(data)
								{
									container.html(data);
									$("input:submit").button()
									 .css({
									    'text-align' : 'left',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									$('select').selectmenu();
									$('input[type=text]').button()
								    .off('mouseenter').off('mousedown').off('keydown')
								    .css({
									          'font' : 'inherit',
									         'color' : 'inherit',
									    'background' : '#FFFFFF',
									    'text-align' : 'left',
									'vertical-align' : 'center',
									       'outline' : 'none',
									        'cursor' : 'text',
									        'height' : '20px',
									     'font-size' : '0.85em'
									  });
									var date1 = $("input:hidden[name=hidden_datedeb]").val();
									var date2 = $("input:hidden[name=hidden_datefin]").val();
									var datedebbis = date1.split('-');
									var datefinbis = date2.split('-');
									var datedeb = new Date(datedebbis[0],datedebbis[1]-1,datedebbis[2]+1); 
									var datefin = new Date(datefinbis[0],datefinbis[1]-1,datefinbis[2]+1);
							        $("#datepicker_deb").datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										defaultDate: datedeb,
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $("#datepicker_fin").datepicker(
							        { 
										dateFormat: 'yy-mm-dd',
										defaultDate: datefin,
										clickInput: true,
										changeMonth : true,
										changeYear :true,
										showOn: "button",
										buttonImage: "<?php echo base_url().'images/logo/calendar-icon.gif'?>",
										buttonImageOnly: true
							        });
							        $('#datepicker_deb').datepicker('setDate',currentdate);
							        $('#datepicker_fin').datepicker('setDate',currentdate);
								}
							}
						});
			});

			$('div[id^="info_emploi_"]').on('submit',function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE;?>&GMEM_CODE="+$(this).find('form').find('input:hidden[name=GMEM_CODE]').val()+"&GMEM_FONCTION="+$(this).find('form').find("input[name=GMEM_FONCTION]").val()+"&GMEM_EMAIL="+$(this).find('form').find("input[name=GMEM_EMAIL]").val()+"&GMEM_TELEPHONE="+$(this).find('form').find("input[name=GMEM_TELEPHONE]").val()+"&GMEM_NOM_ENTREPRISE="+$(this).find('form').find("input[name=GMEM_NOM_ENTREPRISE]").val()+"&GMEM_TYPE_CONTRAT="+$(this).find('form').find("select[name=GMEM_TYPE_CONTRAT]").val()+"&GMEM_DATE_EMBAUCHE="+$(this).find('form').find("input[name=GMEM_DATE_EMBAUCHE]").val()+"&GMEM_DATE_FIN="+$(this).find('form').find("input[name=GMEM_DATE_FIN]").val()+"&GMEM_SALAIRE_ANNUEL="+$(this).find('form').find("input[name=GMEM_SALAIRE_ANNUEL]").val()+"&GMEM_ADRESSE="+$(this).find('form').find("input[name=GMEM_ADRESSE]").val()+"&GMEM_CODE_POSTAL="+$(this).find('form').find("input[name=GMEM_CODE_POSTAL]").val()+"&GMEM_VILLE="+$(this).find('form').find("input[name=GMEM_VILLE]").val()+"&GMEM_PAYS="+$(this).find('form').find("input[name=GMEM_PAYS]").val()+"&GMEM_NUMERO_ORDRE="+$(this).find('form').find("select[name=GMEM_NUMERO_ORDRE]").val()+"&GMEM_ACTUEL="+$(this).find('form').find("input[name=GMEM_ACTUEL]:checked").val();
				$.ajax({
							url : $(this).find('form').attr('action'),
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $('#travail_ancien'); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#info_observation").on('click','.a_edit_observation',function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>";
				var url_link = $(this).attr('href');
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_observation"); 
								if(data)
								{
									container.html(data);
									$("button, input:submit, input:button").button();
									$('textarea').button()
								    .addClass('ui-textfield')
								    .off('mouseenter').off('mousedown').off('keydown');
								    $('textarea[name="GMET_REMARQUES"]').val($('textarea[name="GMET_REMARQUES"]').find('span').html());
								}
							}
						});
			});

			$("#info_observation").on('submit', function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>&GMET_REMARQUES="+$(this).find('form').find("textarea[name=GMET_REMARQUES]").val();
				var url_link = $(this).find('form').attr('action');
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_observation"); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#info_coordonnees_1").on('click','.a_edit_coordonnees_1',function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>";
				var url_link = $(this).attr('href');
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_coordonnees_1"); 
								if(data)
								{
									container.html(data);
									$("button, input:submit, input:button").button();
									$('input:text, input:password, input[type=email],textarea').button()
								    .addClass('ui-textfield')
								    .off('mouseenter').off('mousedown').off('keydown');
								}
							}
						});
			});

			$("#info_coordonnees_1").on('submit', function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>&GMET_ADRESSE_FRANCE="+$(this).find('form').find("input[name=GMET_ADRESSE_FRANCE]").val()+"&GMET_CODE_POSTAL="+$(this).find('form').find("input[name=GMET_CODE_POSTAL]").val()+"&GMET_VILLE="+$(this).find('form').find("input[name=GMET_VILLE]").val()+"&GMET_PAYS="+$(this).find('form').find("input[name=GMET_PAYS]").val();
				var url_link = $(this).find('form').attr('action');
				alert(data_form+" - "+url_link);
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_coordonnees_1"); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});

			$("#info_coordonnees_2").on('click','.a_edit_coordonnees_2',function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>";
				var url_link = $(this).attr('href');
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_coordonnees_2"); 
								if(data)
								{
									container.html(data);
									$("button, input:submit, input:button").button();
									$('input:text, input:password, input[type=email],textarea').button()
								    .addClass('ui-textfield')
								    .off('mouseenter').off('mousedown').off('keydown');
								}
							}
						});
			});

			$("#info_coordonnees_2").on('submit', function(e) {
				e.preventDefault();
				var data_form = "GMET_CODE=<?php echo $etudiant->GMET_CODE ?>&GMET_TELEPHONE_DOMICILE="+$(this).find('form').find("input[name=GMET_TELEPHONE_DOMICILE]").val()+"&GMET_TELEPHONE_PORTABLE="+$(this).find('form').find("input[name=GMET_TELEPHONE_PORTABLE]").val()+"&GMET_EMAIL_2="+$(this).find('form').find("input[name=GMET_EMAIL_2]").val();
				var url_link = $(this).find('form').attr('action');
				alert(data_form+" - "+url_link);
				$.ajax({
							url : url_link,
							type : 'POST', 
							data : data_form,
							success : function(data)
							{	
								var container = $("#info_coordonnees_2"); 
								if(data)
								{
									container.html(data);
								}
							}
						});
			});
		});
	  	$(function()
	  	{

	  		 $.widget( "custom.iconselectmenu", $.ui.selectmenu, {
			_renderItem: function( ul, item ) {
			var li = $( "<li>", { text: item.label } );
			if ( item.disabled ) {
			li.addClass( "ui-state-disabled" );
			}
			$( "<span>", {
			style: item.element.attr( "data-style" ),
			"class": "ui-icon " + item.element.attr( "data-class" )
			})
			.appendTo( li );
			return li.appendTo( ul );
			}
			});
	  		$("#select_sns").iconselectmenu()
			.iconselectmenu( "menuWidget" )
			.addClass( "ui-menu-icons customicons" );
			$('#select_sns option:contains("skype")').attr("data-class", "skype");
			$('#select_sns option:contains("linkedin")').attr("data-class","linkedin");
			$('#select_sns option:contains("facebook")').attr("data-class","facebook");

			$("#select_langue").iconselectmenu()
			.iconselectmenu( "menuWidget" )
			.addClass( "ui-menu-icons customicons" );
			$('#select_langue option[value="francais"]').attr("data-class", "francais");
			$('#select_langue option[value="anglais"]').attr("data-class","anglais");
			$('#select_langue option[value="allemand"]').attr("data-class","allemand");
			$('#select_langue option[value="italien"]').attr("data-class","italien");
			$('#select_langue option[value="espagnol"]').attr("data-class","espagnol");

	  		$("#accordion").accordion(
	  		{
	  			collapsible: true,
	  			heightStyle: "content"
	  		});
	  		$("button, input:submit, input:button").button();
	  		$('input:text, input:password, input[type=email],textarea').button()
		    .addClass('ui-textfield')
		    .off('mouseenter').off('mousedown').off('keydown');
		    
	  		$("#upload_file").customFileInput();

	  		$(".customfile-button").button()
	  		.mouseover(function(){ upload.addClass('ui-state-hover'); })
			.mouseout(function(){ upload.removeClass('ui-state-hover'); });

	  		
	  	});
	  </script>
	</head>
	<body>
		<div id="page">
      		<div id="header"> 
        		<?php include("/../base_site/header_base_site.php");?>
      		</div>
      		<div id="contenu">
        		<?php include("/../base_site/menu_gauche_base_site.php");?>
        		<div id="content" class="narrowcolumn">
					<div id="detail_ancien_content" class="post">
						<div id="menu_ancien">
								
						</div>
						<h2 class="title"><?php echo lang('titre').' '.$etudiant->GMET_NOM.' '.$etudiant->GMET_PRENOM;?></h2>
						<div id="menu_links">
							<ul>
								<li>
									<?php echo anchor("etudiant_c/modification_etudiant/".$etudiant->GMET_CODE,lang('modifier'));?>
								</li>
								<li>
									<?php echo anchor("ancien_c/ancien_annuaire/",lang('annuaire_ancien'));?>
								</li>
								<li>
									<a href="#" id="link_div_photo"><?php echo lang('add_photo');?></a>
								</li>
								<li>
									<a href="#" id="link_div_file"><?php echo lang('add_file');?></a>
								</li>
								<li>
									<a href="#" id="link_div_sns"><?php echo lang('add_sns');?></a>
								</li>
							</ul>
						</div>
						<div class="entry">
	        				<?php if($message != ''){ ?>
	    						<div class="alert alert-danger">
	    							<?php echo $message;?>
	    						</div>
	    					<?php } ?>
							<div id="info_promo" class="info_ancien">
								<?php foreach ($promos as $promo):?>
								<?php
									echo '<p>'.anchor("promotion_c/etudiant_promotion_by_year/".$promo->GMPR_ANNEE."/",$promo->GMFO_NIVEAU.' '.$promo->GMFO_FORMATION.' <span class="capital">'.$promo->GMANT_VILLE.'</span> '.$promo->GMPR_ANNEE);
									if($promo->GMPR_ETAT_ETUDIANT=='etudiant_ajourne')
									{
										echo ' ('.lang('etudiant_ajourne').')';
									}
									echo '</p>';
								?>
								<?php endforeach;?>
							</div>
	    					<div id="info_gen_photo">
								<div id = "info_general" class="info_ancien">
									<?php 

									$date_naiss = $etudiant->GMET_DATE_NAISSANCE;
									$date = explode('-', $date_naiss);
									$date_mois = "";
									switch ($date[1]) {
										case '01':
											$date_mois = lang('cal_january');
											break;
										case '02':
											$date_mois = lang('cal_february');
											break;
										case '03':
											$date_mois = lang('cal_march');
											break;
										case '04':
											$date_mois = lang('cal_april');
											break;
										case '05':
											$date_mois = lang('cal_may');
											break;
										case '06':
											$date_mois = lang('cal_june');
											break;
										case '07':
											$date_mois = lang('cal_july');
											break;
										case '08':
											$date_mois = lang('cal_august');
											break;
										case '09':
											$date_mois = lang('cal_september');
											break;
										case '10':
											$date_mois = lang('cal_october');
											break;
										case '11':
											$date_mois = lang('cal_november');
											break;
										case '12':
											$date_mois = lang('cal_december');
											break;
									}

										//echo lang('promotion').$ancien->getNamePromotion().'<br />';
										echo '<p><span class="label">'.lang('civilite').'</span>'.$etudiant->GMET_CIVILITE.'</p>';
										echo '<p><span class="label">'.lang('nom').'</span>'.$etudiant->GMET_NOM.'</p>';
										echo '<p><span class="label">'.lang('prenom').'</span>'.$etudiant->GMET_PRENOM.'</p>';
										echo '<p><span class="label">'.lang('date_naissance').'</span><span class="minuscule">'.sprintf(lang('date_naissance_ecrite'),$date[2],$date_mois,$date[0]).'</span></p>';
										echo '<p><span class="label">'.lang('lieu_naissance').'</span><span class="capital">'.$etudiant->GMET_LIEU_NAISSANCE.'</span></p>';
										echo '<p><span class="label">'.lang('pays_naissance').'</span><span class="majuscule">'.$etudiant->GMET_PAYS_NAISSANCE.'</span></p>';
									    echo '<p><span class="label">'.lang('nationalite').'</span>'.$etudiant->GMET_NATIONALITE.'</p>';
									?>
								</div>
								<div id = "info_photo" class="info_ancien">
								    <p><img class="photo" src="<?php echo base_url().$etudiant->GMET_PHOTO; ?>" /></p>
								    <p><a id="change_photo" href="#"><?php echo lang('modifier');?></a></p>
								</div>
							</div>
							<div id="info_file_social">
								<div id = "info_files" class="info_ancien">
									<?php echo '<p><a href="#" class="plus_add" id="plus_div_file"><span class="ui-icon ui-icon-plusthick"></span></a></p>';?>
									<?php if (empty($files))
										{
											echo sprintf(lang('nofile'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
										}
									?>
									<?php $i=0; $j=0; $k=0;?>
									<?php foreach ($files as $file):?>
									<?php if ($file->GMDA_STATUT=='actif')
										{
											$i++;
										}

										if ($file->GMDA_STATUT=='desactive')
										{
											$j++;
										}
										$k++;
									?>
									<?php echo form_open();?>
										<div class="div_info_files">
											<span>
												<?php 
													$target = array('class' => 'link','target' => '_blank');
													echo anchor(base_url().$file->GMDA_DOCUMENT,$file->GMDA_NOM.' '.$file->GMDA_LANGUE.' ('.$file->GMDA_STATUT.')',$target);
												?>
											</span>
											<span>
												<?php
													$delet = array(
													 					'id' => 'a_delete'.$k,
													 					'class' => 'link a_link_file',
													 					'title' => sprintf(lang('deletefile'),$file->GMDA_LANGUE,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
													 				);
													echo anchor("etudiant_c/delete_file",'<span class="ui-icon ui-icon-trash trash"></span>',$delet);
												?>
											</span>
											<span class="action_link">
												<?php 
													echo form_hidden('GMDA_CODE',$file->GMDA_CODE);
													
													if($file->GMDA_STATUT=="actif")
													{
													 	$desac = array(
													 					'id' => 'a_desactivate',
													 					'class' => 'link a_link_file'
													 				);
														echo anchor("etudiant_c/desactivate_file",lang('desactive'),$desac);
													}
													else
													{
														$act = array(
													 					'id' => 'a_activate',
													 					'class' => 'link a_link_file'
													 				);
														echo anchor("etudiant_c/activate_file",lang('actif'),$act);
													}
												?>
											</span>
											</div>
											<?php echo form_close();?>
									<?php endforeach;?>
									<p id="link_all_activate">
										<?php
											if($i>0)
											{
												$all_des = array(
												 					'id' => 'a_all_desactivate',
												 					'class' => 'link a_link_file'
												 				);
												echo anchor("etudiant_c/desactivate_all_files",lang('desactivateallfiles'),$all_des);
											}
											else if ($j>0)
											{
												$all_act = array(
												 					'id' => 'a_all_activate',
												 					'class' => 'link a_link_file'
												 				);
												echo anchor("etudiant_c/activate_all_files",lang('activateallfiles'),$all_act);
											}
										?>
									</p>
								</div>
								<div id = "info_social_networks" class="info_ancien">
									<?php echo '<a href="#" class="plus_add_sns" id="plus_div_sns"><span class="ui-icon ui-icon-plusthick"></span></a>';?>
									<?php if (empty($networks))
										{
											echo sprintf(lang('nonetwork'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
										}
									?>
									<?php $i=0; $j=0;?>
									<?php foreach ($networks as $network):?>
									<?php if ($network->GMERS_STATUT=='actif')
										{
											$i++;
										}

										if ($network->GMERS_STATUT=='desactive')
										{
											$j++;
										}
										?>
										<?php echo form_open();?>
											<div class="div_show_sns">
												<span>
													<?php 
														echo form_hidden('GMRS_CODE',$network->GMRS_CODE);
														$class_link='link';
														if($network->GMERS_STATUT=='desactive')
														{
															$class_link='link disabled';
														}

														switch ($network->GMRS_NOM){

														case "skype":
														{

															echo '<a class="'.$class_link.'" href="skype:'.$network->GMERS_LINK.'?userinfo" title="'.sprintf(lang('title_skype'),$network->GMRS_NOM,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM).'"><img class="logo_sns" src="'.base_url().$network->GMRS_LOGO.'"/></a>';
															break;
														}
														default:
														{
															$other = array(
																				'target' => '_blank',
															 					'class' => $class_link,
															 					'title' => sprintf(lang('title_other_sns'),$network->GMRS_NOM,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
															 				);
															echo anchor($network->GMERS_LINK,'<img class="logo_sns" src="'.base_url().$network->GMRS_LOGO.'"/>',$other);
															break;
														}
													}
													?>
												</span>
												<span>
													<?php
														$delet_sns = array(
														 					'class' => 'link a_delete_sns',
														 					'title' => sprintf(lang('deletesns'),$network->GMRS_NOM,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
														 				);
														echo anchor("etudiant_c/delete_sns",'<span class="ui-icon ui-icon-trash trash_sns"></span>',$delet_sns);
													?>
												</span>
												<span class="action_link_sns">
												<?php 
													
													if($network->GMERS_STATUT=="actif")
													{
													 	$desac = array(
													 					'class' => 'link a_activation'
													 				);
														echo anchor("etudiant_c/desactivate_sns",lang('desactive'),$desac);
													}
													else
													{
														$act = array(
													 					'class' => 'link a_activation'
													 				);
														echo anchor("etudiant_c/activate_sns",lang('actif'),$act);
													}
												?>
												</span>
											</div>
										<?php echo form_close();?>
									<?php endforeach;?>
									<p id="sns_all_activate">
										<?php
											if($i>0)
											{
												$all_des = array(
												 					'class' => 'link a_activation_all_sns'
												 				);
												echo anchor("etudiant_c/desactivate_all_sns",lang('desactivateallsns'),$all_des);
											}
											else if ($j>0)
											{
												$all_act = array(
												 					'class' => 'link a_activation_all_sns'
												 				);
												echo anchor("etudiant_c/activate_all_sns",lang('activateallsns'),$all_act);
											}
										?>
									</p>
								</div>
							</div>
							<div id="info_coordonnees">
								<div id = "info_coordonnees_1" class="info_ancien">
									<span>
										<?php
											$edit_coor_1 = array(
											 					'class' => 'link a_edit_coordonnees_1',
											 					'title' => sprintf(lang('editadresse'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
											 				);
											echo anchor("etudiant_c/form_edit_address",'<span class="ui-icon ui-icon-pencil pencil_obs"></span>',$edit_coor_1);
										?>
									</span>
									<?php	
										echo '<p><span class="label">'.lang('adresse').'</span>'.$etudiant->GMET_ADRESSE_FRANCE.'</p>';
										echo '<p><span class="label">'.lang('code_postal').'</span>'.$etudiant->GMET_CODE_POSTAL.'</p>';
										echo '<p><span class="label">'.lang('ville').'</span><span class="capital">'.$etudiant->GMET_VILLE.'</span></p>';
										echo '<p><span class="label">'.lang('pays').'</span><span class="majuscule">'.$etudiant->GMET_PAYS.'</span></p>';
									?>
								</div>
								<div id = "info_coordonnees_2" class="info_ancien">
									<span>
										<?php
											$edit_coor_2= array(
											 					'class' => 'link a_edit_coordonnees_2',
											 					'title' => sprintf(lang('editadresse'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
											 				);
											echo anchor("etudiant_c/form_edit_mail_tel",'<span class="ui-icon ui-icon-pencil pencil_obs"></span>',$edit_coor_2);
										?>
									</span>
									<?php
										echo '<p><span class="label">'.lang('telephone_personnel').'</span>'.$etudiant->GMET_TELEPHONE_DOMICILE.'</p>';
										echo '<p><span class="label">'.lang('portable').'</span>'.$etudiant->GMET_TELEPHONE_PORTABLE.'</p>';
										echo '<p><span class="label">'.lang('email_1').'</span>'.$etudiant->GMET_EMAIL.'</p>';
										echo '<p><span class="label">'.lang('email_2').'</span>'.$etudiant->GMET_EMAIL_2.'</p>';
									?>
								</div>
							</div>
							<div id="info_observation" class="info_ancien">
								<span>
										<?php
											$edit_obs = array(
											 					'class' => 'link a_edit_observation',
											 					'title' => sprintf(lang('editobservation'), $etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
											 				);
											echo anchor("etudiant_c/form_edit_observation",'<span class="ui-icon ui-icon-pencil pencil_obs"></span>',$edit_obs);
										?>
									</span>
								<?php
									echo '<p><span class="label">'.lang('observation').'</span>'.$etudiant->GMET_REMARQUES.'</p>';
								?>
							</div>
							<div id = "accordion">
								<h3><?php echo lang('info_studies');?></h3>
								<div id = "info_studies">
									<?php
										$form_add_studies = array(
										 					'class' => 'plus_add_studies',
										 					'id' => 'plus_form_div_studies',
										 					'title' => lang('add_studies')
										 				);
										echo anchor("etudiant_c/form_add_studies",'<span class="ui-icon ui-icon-plusthick"></span>',$form_add_studies);
										$es = 0;
									?>
									<?php if (empty($studies))
										{
											echo sprintf(lang('nostudies'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
										}
									?>
									<div id="add_studies">
									</div>
									<?php if(!empty($studies))
									{?>
									<div id="list_studies">
										<table>
											<thead>
												<tr>
													<th><?php echo lang('etablissement');?></th>
													<th><?php echo lang('option');?></th>
													<th><?php echo lang('specialsisation');?></th>
													<th><?php echo lang('date_deb_studies');?></th>
													<th><?php echo lang('date_fin_studies');?></th>
													<th><?php echo lang('diplome');?></th>
													<th><?php echo lang('releve_note');?></th>
													<th><?php echo lang('action');?></th>
												</tr>
											</thead>
											<tbody>
												<?php foreach ($studies as $study):?>
													<?php $es++;?>
													<tr id = "info_study_<?php echo $es; ?>">
														<td><?php echo $study->GMES_ETABLISSEMENT;?></td>
														<td><?php echo $study->GMES_OPTION;?></td>
														<td><?php echo $study->GMES_SPECIALISATION;?></td>
														<td><?php echo $study->GMES_DATE_DE_DEBUT;?></td>
														<td><?php echo $study->GMES_DATE_DE_FIN;?></td>
														<td><?php echo anchor(base_url().'/'.$study->GMES_DIPLOME,$study->GMES_NOM_DU_DIPLOME);?></td>
														<td><?php echo $study->GMES_RELEVE_DE_NOTES;?></td>
													</tr>
												<?php endforeach;?>
											</tbody>
										</table>
									</div>
									<?php } ?>
								</div>

								<h3><?php echo lang('info_stage');?></h3>
								<div id = "info_stage">
									<?php
										$form_add_stage = array(
										 					'class' => 'plus_add_stage',
										 					'id' => 'plus_form_div_stage',
										 					'title' => lang('add_stage')
										 				);
										echo anchor("etudiant_c/form_add_stage",'<span class="ui-icon ui-icon-plusthick"></span>',$form_add_stage);
										
									?>
									<?php if (empty($stages))
										{
											echo sprintf(lang('nostage'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
										}
									?>
									<div id="add_stage">
									</div>
									<div id="list_stage">
										
									</div>
								</div>

								<h3><?php echo lang('emploi_ancien');?></h3>
								<div id = "travail_ancien">
									<?php
										$form_add_emploi = array(
										 					'class' => 'plus_add_emploi',
										 					'id' => 'plus_form_div_emploi',
										 					'title' => lang('add_emploi')
										 				);
										echo anchor("etudiant_c/form_add_emploi",'<span class="ui-icon ui-icon-plusthick"></span>',$form_add_emploi);
									?>
									<?php if (empty($emplois))
										{
											echo sprintf(lang('noemploi'),$etudiant->GMET_NOM,$etudiant->GMET_PRENOM);
										}
									?>
									<?php $i=0;?>
									<?php foreach ($emplois as $emploi):?>
										<?php $i++;?>
										<div id = "info_emploi_<?php echo $i; ?>" class="info_ancien emploi_class">
											<?php echo form_open('etudiant_c/edit_emploi');?>
												<?php echo form_hidden('GMEM_CODE',$emploi->GMEM_CODE);?>
												<span>
													<?php
														$edit_emploi = array(
														 					'class' => 'link a_edit_emploi',
														 					'title' => sprintf(lang('editemploi'),$emploi->GMEM_NUMERO_ORDRE,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
														 				);
														echo anchor("etudiant_c/form_edit_emploi",'<span class="ui-icon ui-icon-pencil pencil_emploi"></span>',$edit_emploi);
														$delet_emploi = array(
														 					'class' => 'link a_delete_emploi',
														 					'title' => sprintf(lang('deleteemploi'),$emploi->GMEM_NUMERO_ORDRE,$etudiant->GMET_NOM,$etudiant->GMET_PRENOM)
														 				);
														echo anchor("etudiant_c/delete_emploi",'<span class="ui-icon ui-icon-trash trash_emploi"></span>',$delet_emploi);
													?>
												</span>
												<?php echo '<p><span class="label">'.sprintf(lang('number_emploi'),$emploi->GMEM_NUMERO_ORDRE).'</span>';
													if($emploi->GMEM_ACTUEL==1)
													{
														echo '<span class="label minuscule">('.lang('actuel_emploi').')</span>';
													}
													echo '<span class="contenu_span">'.sprintf(lang('date_emploi'),$emploi->GMEM_DATE_EMBAUCHE,$emploi->GMEM_DATE_FIN).'</span></p>';
												?>
												<?php echo '<div><p><span class="label"><span class="majuscule">'.UTF8_decode($emploi->GMEM_FONCTION).'</span> '.sprintf(lang('type_contrat_salaire'),$emploi->GMEM_TYPE_CONTRAT,$emploi->GMEM_SALAIRE_ANNUEL).'</span>';
													echo '</p></div>';
												?>
												<?php echo '<div>';
													echo '<p><span class="label">'.lang('nom_entreprise').'</span><span class="contenu_span majuscule">'.$emploi->GMEM_NOM_ENTREPRISE.'</span>';
													echo '<span class="label">'.lang('tel_emploi').'</span><span class="contenu_span">'.$emploi->GMEM_TELEPHONE.'</span>';
													echo '<span class="label">'.lang('email_emploi').'</span><span class="contenu_span">'.$emploi->GMEM_EMAIL.'</span></p>';
													echo '<p><span class="label">'.lang('adr_emploi').'</span><div id="adr"><p class="contenu_span">'.$emploi->GMEM_ADRESSE.'</p><p class="contenu_span">'.$emploi->GMEM_CODE_POSTAL.' <span class="capital">'.$emploi->GMEM_VILLE.'</span></p><p class="contenu_span"><span class="majuscule">'.$emploi->GMEM_PAYS.'</span></p></div></p>';
													echo '</div>';
												?>
											<?php echo form_close(); ?>
										</div>
							        <?php endforeach?>
								</div>	
							</div>
							<div id="div_photo" class="div_hide">
								<?php
									echo '<p><a href="#" class="close" id="close_div_photo"><span class="ui-icon ui-icon-closethick"></span></a></p>';
									$form_photo = array(
													'class' => "pure-form pure-form-aligned"
										);
							        echo form_open_multipart('etudiant_c/edit_profilepic');
							        $Fdata = array(
							     					'name' => 'GMET_PHOTO',
							     					'class' => 'file',
							     					'id' => 'upload_file'
							     				); 
							        echo form_hidden('id',$etudiant->GMET_CODE);
							        $lab = array('class' => 'label');
							        echo '<p>'.form_label(lang('photo'),'GMET_PHOTO',$lab).'</p>';
							        echo '<p>'.form_upload($Fdata).'</p>'; 
							        $form_photo_submit = array(
							        					'name' => 'mysubmit',
							        					'value' => lang('add_photo'),
							        					'class' => 'ui-button',
							        	);
							        echo '<p>'.form_submit($form_photo_submit).'</p>'; 
							        echo form_close();
								?>
							</div>

							<div id="div_file" class="div_hide">
								<?php
									echo '<p><a href="#" class="close" id="close_div_file"><span class="ui-icon ui-icon-closethick"></span></a></p>';
							        echo form_open_multipart('etudiant_c/add_file');
							        $Fdata = array(
							     					'name' => 'GMDA_DOCUMENT',
							     					'class' => 'file',
							     					'id' => 'upload_file'
							     				); 
							        echo form_hidden('GMET_CODE',$etudiant->GMET_CODE);
							        $name_cv =array(
							        				'name' => 'GMDA_NOM',
							        				'readonly' => 'readonly',
							        				'value' => 'CV'
							        	);
							        $lab = array('class' => 'label');
							        echo '<p>'.form_label(lang('th_nom'),'GMDA_NOM',$lab).'</p>';
							        echo '<p>'.form_input($name_cv).'</p>';
							        $language ='id="select_langue"';
							        $langue_cv = array(
                                        'francais' => lang('francais'),
                                        'anglais' => lang('anglais'),
                                        'allemand' => lang('allemand'),
                                        'italien' => lang('italien'),
                                        'espagnol' => lang('espagnol')
                                      );
							        echo '<p>'.form_label(lang('langue'),'GMDA_LANGUE',$lab).'</p>';
                					echo '<p>'.form_dropdown('GMDA_LANGUE',$langue_cv,'',$language).'</p>';
                					echo '<p>'.form_label(lang('file'),'GMDA_DOCUMENT',$lab).'</p>';
							        echo '<p>'.form_upload($Fdata).'</p>'; 
							        echo '<p>'.form_submit('mysubmit', lang('add_file')).'</p>'; 
							        echo form_close();
								?>
							</div>
							<div id="div_sns" class="div_hide">
								<?php
									echo '<p><a href="#" class="close" id="close_div_sns"><span class="ui-icon ui-icon-closethick"></span></a></p>';
							        echo form_open('etudiant_c/add_sns');
							        echo form_hidden('GMET_CODE',$etudiant->GMET_CODE);
							        $lab = array('class' => 'label');
							        $sns_choice = array();
							        foreach($sns as $sn)
							        {
									    $sns_choice[$sn->GMRS_CODE] = $sn->GMRS_NOM;
									}
									$sel ='id="select_sns"';
							        echo '<p>'.form_label(lang('sns'),'GMRS_CODE',$lab).'</p>';
                					echo '<p>'.form_dropdown('GMRS_CODE',$sns_choice,'',$sel).'</p>';
                					$name_cv =array(
							        				'name' => 'GMERS_LINK'
							        	);
							        
							        echo '<p>'.form_label(lang('link_login'),'GMERS_LINK',$lab).'</p>';
							        echo '<p>'.form_input($name_cv).'</p>';
							        echo '<p>'.form_submit('mysubmit', lang('add_sns')).'</p>'; 
							        echo form_close();
								?>
							</div>
							<div id="div_job" class="div_hide">
							</div>
						</div>
					</div>	
				</div>
        	</div>
        	<?php include("/../base_site/footer_base_site.php");?>
        </div>			
	</body>
</html>

